package com.baizhi.cmfzmanager.controller;

import com.baizhi.cmfzmanager.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
public class LogController {

    @Autowired
    private LogService logService;

    @RequestMapping("/getLogs")
    public Map getLogs(int page,int rows){
        return logService.getLogs(page,rows);
    }

    @RequestMapping("/deleteLogs")
    public Map deleteLogs(int[] ids){
        Map map = new HashMap();
        try {
            logService.delete(ids);
            map.put("message","删除成功11111!!!");
        } catch (Exception e) {
            e.printStackTrace();
            map.put("message","删除失败!!!");
        }
        return map;
    }

}
